/**
 * 按钮
 * 扩展显示隐藏能力
 */

import * as React from 'react'
import { Button, Popconfirm, PopconfirmProps } from 'antd';

interface ConfirmButtonProps extends PopconfirmProps {
  
}

export default function ConfirmButton(props: ConfirmButtonProps) {
  let { style,title,description,children, onConfirm, ...rest } = props;
  if(!title){
    title = "删除"
  }
  if(!description){
    description="确定删除吗？"
  }
  if(!children){
    children = "删除"
  }
  return <Popconfirm
    placement="topRight"
    okButtonProps={{color:"danger", variant:"solid"}}
    onConfirm={onConfirm}
    title={title}
    description={description}
    {...rest}
    style={style}
    >
        <Button danger type="link" >{children}</Button>
    </Popconfirm>
}